home *** CD-ROM | disk | FTP | other *** search
/ 100 Plus Great Games 2 / 100PLUSV2.BIN / games / Reversi.dxr / playing cards_128.ls < prev    next >
Encoding:
Text File  |  2002-01-25  |  1.0 KB  |  38 lines

  1. global points, pootimer, win, tableau, crappo, stock, topRow, midRow, botRow
  2.  
  3. on checkwin
  4.   if points = 390 then
  5.     win = "yes"
  6.     pootimer = timeout("poo").new(150, #gotoit)
  7.   else
  8.     checklose()
  9.   end if
  10. end
  11.  
  12. on checklose
  13.   if stock.cards.count = 0 then
  14.     repeat with g in [topRow, midRow, botRow]
  15.       repeat with i = 1 to g.count()
  16.         repeat with h = 1 to g.count()
  17.           if i = h then
  18.             next repeat
  19.           end if
  20.           if (sprite(g[i]).member.name = "backofcard") or (chars(sprite(g[i]).member.name, 1, 5) = "empty") then
  21.             next repeat
  22.           end if
  23.           if (chars(sprite(g[i]).member.name, 1, 3) = chars(sprite(g[h]).member.name, 1, 3)) and (((sprite(g[i]).loc - sprite(g[h]).loc) = point(120, 0)) or ((sprite(g[i]).loc - sprite(g[h]).loc) = point(-120, 0))) then
  24.             abort()
  25.           end if
  26.         end repeat
  27.       end repeat
  28.     end repeat
  29.     win = "no"
  30.     pootimer = timeout("poo").new(150, #gotoit)
  31.   end if
  32. end
  33.  
  34. on gotoit
  35.   pootimer.forget()
  36.   go("gameover")
  37. end
  38.